package com.wanxi.test;

import java.util.Scanner;

public class Login {
    public static void main(String[] args) {
        String user = "admin";
        String pass = "111111";
        int count = 0;
        Scanner scanner = new Scanner(System.in);
        while (count < 3) {
            System.out.println("请输入用户名");
            String aa = scanner.next();
            System.out.println("请输入密码");
            String bb = scanner.next();
            if (aa.equals(user) && bb.equals(pass)) {
                System.out.println("密码通过");
                return;
            } else {
                count++;
                System.out.println("你还有" + (3 - count) + "次机会");
            }
        }
//        if (count >= 3) {
            System.out.println("输入错误次数超限");
//        }
    }
}
